{% extends "base.html" %}
{% block content %}
    {{ block.super }}
    <h3> Delete {{ survey }} Questionnaire</h3>
    <p>
        Deleting this Questionnaire will remove any answers associated with it. These relationships are listed below:
    </p>
    <div class="danger-zone panel panel-danger">
        <div class="panel-heading">
            <h3>Danger Zone</h3>
        </div>
        {% if questions and survey.completed %}
            <form class="form form-read-only" method="post">{% csrf_token %}
                {% for question in questions %}
                    {% include "defectDojo-engagement-survey/survey_fields.html" with form=question %}
                {% endfor %}
            </form>
        {% else %}
            <p>No answers found.</p>
        {% endif %}
        {% if rels|length > 1 %}
            <ul class="left">{{ rels|unordered_list }}</ul>
        {% else %}
            <p>No relationships found.</p>
        {% endif %}
        <form class="form-horizontal" method="post">
            {% csrf_token %}
            {{ form }}

            <div class="form-group">
                <button class="btn btn-danger" type="submit" name="delete_name" value="delete_questionnaire">Delete Questionnaire
                </button>
            </div>
        </form>
    </div>
    <br/>
    <br/>
{% endblock %}
{% block add_styles %}
    {{ block.super }}
    .form-read-only {text-align: left !important }
    .form-read-only .control-label{width: 100%; float: none; text-align: left;}
    .form-read-only textarea {width: 90% !important;}
    .form-read-only .controls {margin-left: 10px;}
    .form-read-only .control-group {margin-bottom: 10.5px; margin-left: 10px; text-align: left;}
{% endblock %}
